package top.dprkshow.practice.graph;

import edu.princeton.cs.algs4.KruskalMST;

/**
 * @author Kent HAN
 * @date 2021/9/7
 */
public class Main {
    public static void main(String[] args) {
//        MatrixGraph graph = new MatrixGraph(9);
//        Digraph graph = new Digraph(7);

        WeightedUgraph graph = new WeightedUgraph(8);

//        graph.addEdge(0, 1);
//        graph.addEdge(2, 0);
//        graph.addEdge(1, 2);
//        graph.addEdge(1, 3);
//        graph.addEdge(3, 5);
//        graph.addEdge(5, 6);
//        graph.addEdge(2, 4);
//        graph.addEdge(7, 8);

//        graph.addEdge(0, 5);
//        graph.addEdge(0, 1);
//        graph.addEdge(3, 5);
//        graph.addEdge(5, 2);
//        graph.addEdge(6, 0);
//        graph.addEdge(1, 4);
////        graph.addEdge(0, 2);
//        graph.addEdge(2, 0);
//        graph.addEdge(3, 6);
//        graph.addEdge(3, 4);
//        graph.addEdge(6, 4);
//        graph.addEdge(3, 2);

        graph.addEdge(new Edge(0, 7, 16));
        graph.addEdge(new Edge(2, 3, 17));
        graph.addEdge(new Edge(1, 7, 19));
        graph.addEdge(new Edge(0, 2, 26));
        graph.addEdge(new Edge(5, 7, 28));
        graph.addEdge(new Edge(1, 3, 29));
        graph.addEdge(new Edge(1, 5, 32));
        graph.addEdge(new Edge(2, 7, 34));
        graph.addEdge(new Edge(4, 5, 35));
        graph.addEdge(new Edge(1, 2, 36));
        graph.addEdge(new Edge(4, 7, 37));
        graph.addEdge(new Edge(0, 4, 38));
        graph.addEdge(new Edge(6, 2, 40));
        graph.addEdge(new Edge(3, 6, 52));
        graph.addEdge(new Edge(3, 6, 52));
        graph.addEdge(new Edge(6, 0, 58));
        graph.addEdge(new Edge(6, 4, 93));

//        DfsPaths dfsPaths = new DfsPaths(graph, 7);
//        BfsPaths bfsPaths = new BfsPaths(graph, 0);

//        CC cc = new CC(graph);
//        cc.init(graph);

//        Cycle cycle = new Cycle(graph);
//        cycle.init(graph);

//        Cycle2 cycle2 = new Cycle2(graph);
//        cycle2.init(graph);

//        Bipartite bipartite = new Bipartite(graph);
//        bipartite.init(graph);

//        DfsPaths dfsPaths = new DfsPaths(graph, 7);

//        BfsPaths bfsPaths = new BfsPaths(graph, 0);

//        DirectedCycle directedCycle = new DirectedCycle(graph);
//        directedCycle.init(graph);

//        ReversePostOrder reversePostOrder = new ReversePostOrder(graph);
//        reversePostOrder.init(graph);

//        Digraph reversedGraph = graph.reverse();

//        SCC scc = new SCC(graph);
//        scc.init(graph);

        Prim prim = new Prim(graph);
        prim.init(graph);

    }

}
